import { DataField } from "@formily/core/esm/types";
export const setDeptParams = (form: any, params: any, initParams: any) => {
    form?.getFieldState('deptCode', (state: DataField) => {
        state.componentProps = {
            ...state.componentProps,
            api: {
                "params": {
                    ...params,
                    "type": "DEPARTMENT"
                },
                "type": "GET",
                "url": "/sym/org/findListByParentCode",
            }
        };
        if (initParams) {
            Object.keys(initParams).forEach(key => {
                form.setValuesIn(key, initParams[key])
            })
        }
    });
}